package com.atguigu.product.service;

import com.atguigu.product.entity.ProductAttrValueEntity;
import com.atguigu.product.vo.AttrGroupRelationVo;
import com.atguigu.product.vo.AttrRespVo;
import com.atguigu.product.vo.AttrVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.product.entity.AttrEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author polarisink
 * @email polarisink@163.com
 * @date 2020-12-18 13:31:45
 */
public interface AttrService extends IService<AttrEntity> {

  PageUtils queryPage(Map<String, Object> params);

  void saveAttr(AttrVo attr);

  PageUtils queryBaseAttrPage(Map<String, Object> params, Long catelogId, String attrType);

  AttrRespVo getAttrInfo(Long attrId);

  void updateAttr(AttrVo attr);

  List<AttrEntity> getRelationAttr(Long attrgroupId);

  void deleteRelation(AttrGroupRelationVo[] vos);

  PageUtils getNoRelationAttr(Map<String, Object> params, String attrgroupId);

  /**
   * 所有属性里面挑出检索属性
   *
   * @param attrIds
   * @return
   */
  List<Long> selectSearchAttrIds(List<Long> attrIds);

  List<ProductAttrValueEntity> listAttrsforSpu(Long spuId);

  void updateSpuAttrs(Long spuId, List<ProductAttrValueEntity> attrValueEntities);
}

